#include<stdio.h>
#include<math.h>
double lnchoose(int n, int m)
{
	int i;
	if (m > n)
	{
		return 0;
	}
	if (m < n/2.0)
	{
		m = n-m;
	}
	double s1 = 0;
	for (i=m+1; i<=n; i++)
	{
		s1 += log((double)i);
	}
	double s2 = 0;
	int u = n-m;
	for (i=1; i<=u; i++)
	{
		s2 += log((double)i);
	}
	return s1-s2;
}

int choose(int n, int m)
{
	if (m > n)
	{
		return 0;
	}
	return (int)(exp(lnchoose(n, m))+0.5);
}
int main ()
{
	int n;
	int i;
	double sum;double Sn;
	for(n=1;n<=100000;n++)
	{
		sum=0;
		for(i=0;i<=n;i++)
		{
			sum+=lnchoose(n,i);
		}
		Sn=sum/(double)(n*n);
		printf("n:%d  Sn:%f\n",n,Sn);
	}
	return 0;
}
